Skip to content

Conversation

@sobychacko
Copy link
Contributor

Fixes: #1753

#1753

  • Add character-based truncation (max 2048 chars) for Cohere embedding requests
  • Support both START and END truncation strategies
  • Add unit tests verifying truncation behavior for both strategies

Truncation is applied before sending requests to Bedrock API to avoid ValidationException when text exceeds maximum length. The END strategy (default) keeps the first 2048 characters while START keeps the last 2048 characters.

Fixes: spring-projects#1753

spring-projects#1753

- Add character-based truncation (max 2048 chars) for Cohere embedding requests
- Support both START and END truncation strategies
- Add unit tests verifying truncation behavior for both strategies

Truncation is applied before sending requests to Bedrock API to avoid ValidationException
when text exceeds maximum length. The END strategy (default) keeps the first 2048
characters while START keeps the last 2048 characters.
@markpollack markpollack modified the milestone: 1.0.0-M4 Nov 20, 2024
@markpollack
Copy link
Member

merged in 1abfd9a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cohere embedding model options not truncating as expected

2 participants